import dict from '@/const/dict/dict';

export default {
  height: 'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  dialogClickModal: false,
  grid: false,
  gridBtn: false,
  dialogDrag: true,
  labelWidth: 100,
  defaultSort: {
    prop: 'createTime',
    order: 'descending'
  },
  column: [
    {
      label: '主键',
      prop: 'id',
      type: 'input',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true
    },
    {
      label: '任务名称',
      prop: 'taskName',
      type: 'input',
      maxlength: 50,
      showWordLimit: true,
      search: true,
      searchSpan: 6,
      searchLabelWidth: 100,
      rules: [{
        required: true,
        message: '请输入任务名称',
        trigger: 'blur'
      }]
    },
    {
      label: '设备类型',
      prop: 'deviceType',
      type: 'select',
      dicUrl: '/biz/search/dictionary/dict-biz',
      dicHeaders: { crypto: true },
      dicQuery: { code: 'device' },
      dicMethod: 'post',
      dataType: 'number',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      value: 1,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 100,
      filterable: true,
      virtualize: true,
      rules: [{
        required: true,
        message: '请选择设备类型',
        trigger: 'blur'
      }]
    },
    {
      label: '是否检测',
      prop: 'isCheck',
      type: 'select',
      dicData: dict.yes_no,
      dataType: 'number',
      value: 1,
      rules: [{
        required: true,
        message: '请选择是否检测',
        trigger: 'blur'
      }]
    },
    {
      label: '是否真机',
      prop: 'isRealDevice',
      type: 'select',
      dicData: dict.yes_no,
      dataType: 'number',
      value: 1,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 100,
      filterable: true,
      virtualize: true,
      rules: [{
        required: true,
        message: '请选择是否真机',
        trigger: 'blur'
      }]
    },
    {
      label: '代理平台',
      prop: 'proxyId',
      type: 'cascader',
      multiple: true,
      dicUrl: '/biz/search/select/task-proxy-platform',
      dicHeaders: { crypto: true },
      dicMethod: 'post',
      dataType: 'string',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      emitPath: false,
      expandTrigger: 'click',
      value: '1830547285613178881',
      rules: [{
        required: true,
        message: '请选择代理平台',
        trigger: 'blur'
      }],
      hide: true
    },
    {
      label: '代理(国家)',
      prop: 'proxyCountryId',
      type: 'select',
      dicUrl: '/biz/search/select/country',
      dicHeaders: { crypto: true },
      dicMethod: 'post',
      dataType: 'string',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      filterable: true,
      virtualize: true,
      hide: true
    },
    {
      label: '等待时长',
      labelTip: '验证码等待时长(分钟)',
      prop: 'codeWaitTime',
      type: 'number',
      step: 1,
      stepStrictly: true,
      controls: false,
      value: 6,
      rules: [{
        required: true,
        message: '请输入验证码等待时长',
        trigger: 'blur'
      }],
      hide: true
    },
    {
      label: '重试间隔',
      prop: 'retryInterval',
      type: 'number',
      max: 12,
      step: 1,
      stepStrictly: true,
      controls: false,
      placeholder: '请输入重试间隔(小时),最大重试间隔12小时',
      rules: [{
        required: true,
        message: '请输入重试间隔(小时)',
        trigger: 'blur'
      }]
    },
    {
      label: '线程数',
      prop: 'threadCount',
      type: 'number',
      step: 1,
      stepStrictly: true,
      controls: false,
      value: 1,
      rules: [{
        required: true,
        message: '请输入线程数',
        trigger: 'blur'
      }]
    },
    {
      label: '正则表达式',
      prop: 'regularEx',
      type: 'input',
      placeholder: '为空则使用默认规则',
      overHidden: true
    },
    {
      label: '文件地址',
      prop: 'fileUrl',
      type: 'upload',
      dataType: 'string',
      listType: 'text',
      accept: '.txt',
      tip: '上传txt,单次任务最大数量10W.格式: +号码|URL 或者 +号码----URL 号码前+可有可无',
      limit: 1,
      action: '/biz/upload/put-file',
      headers: { crypto: true },
      propsHttp: {
        res: 'data',
        url: 'link'
      },
      rules: [{
        required: true,
        message: "请上传附件",
        trigger: "blur"
      }],
      viewDisplay: false,
      editDisplay: false,
      hide: true
    },
    {
      label: '号码总数',
      prop: 'total',
      type: 'number',
      controls: false,
      addDisplay: false,
      editDisplay: false
    },
    {
      label: '创建时间',
      prop: 'createTime',
      type: 'datetime',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      search: true,
      searchRange: true,
      searchSpan: 8,
      searchOrder: 99,
      sortable: 'custom',
      width: 180
    },
    {
      label: '状态',
      prop: 'status',
      type: 'switch',
      dicData: dict.enable_disable,
      dataType: 'number',
      value: 1,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 75,
      filterable: true,
      virtualize: true,
      rules: [{
        required: true,
        message: '请选择状态',
        trigger: 'blur'
      }]
    }
  ]
};
